MotionWS-2


Prerequisites and requirements

MotionWS2 requires mIRC v6.12 or later to run properly.

Besides that, MotionWS doesn't require any fancy hardware, it should run fine on any computer that can run mIRC. MotionWS have been successfully tested on a 300mhz celeron with 512mb ram.

Note! MotionWS requires a NT-based operative system with Windows Scripting Host enabled for the CGI gateway to function properly. If you are not planning to use the CGI functionality, then don't worry about this.

Effective disk space requirements is around 160KB.

Installation

Installing MotionWS2 is fairly straight forward:
  • Unzip the archive to your mIRC directory, or a subdirectory within your mIRC directory
  • Type /load -rs your_directory\motionws2.mrc
  • Type /mws.config to configure MotionWS2
  • Type /mws.start to start MotionWS2
  • What's MotionWS2?

    It's a webserver (httpd) written in the scripting language provided by the IRC client mIRC. Designed to be as stable, fast and useful as possible, MotionWS2 confirms its place as the state of the art mIRC webserver.

    The obvious flaws that were present in MotionWS1 have been removed, and everything has been rewritten from scratch.

    You can use MotionWS2 to share your files and folders to other users on IRC. You can even password protect them, to only allow your closest friends to access them.

    Configuring MotionWS2

    Configuring MotionWS is simple and very straight forward. You open the configuration dialog using the command /mws.config or by accessing the menu item "Configure" from your menubar menu -> MotionWS2 menu.

    Main settings

    Listen on port: This is the port on which the webserver will listen for incoming connections. The common HTTP port is 80, however you can se it to whatever port you like.

    Htdocs: This is the folder from which you will share your files and folders. The default value is your_install_directory_\htdocs. By default, all files and folders within this directory can be downloaded, and have their content listed. You can however change that on the advanced settings tab.

    Directory index: These are the files that the webserver will interpret as "directory index files", or the file to display if no file is requested, only a directory. Priority left-to-right, multiple elements must be separated by commas.

    Htaccess: This sets the filename for the directory access file, a file in which you can put directives to control how MotionWS should display directories and/or files. This file will be completely invisible to anyone who accesses your webserver, and it can not be downloaded.

    Server name: This is a name you can give your server. Should be something like www.MyWebserver.com

    Echo debug info: Turns on or off output of debug information. Debug information is detailed information of what MotionWS is currently doing. This information is for the biggest part useless for most users of MotionWS, however you can turn it on if you are having a problem you want to try solving yourself. Turning this feature on will lead to lower performance, and might cause MotionWS2 to lock mIRC for short periods during heavy loads.

    Debug log: Turns on or off logging of debug information to a file. Turning this on will seriously affect performance. Only use this feature if you want to report a bug in MotionWS2. To report bugs, please view the bug reporting section of this file.

    Advanced settings

    Max upload speed: This sets the maximum amount of bandwidth MotionWS2 can utilize. Setting it to 0 (zero) will be interpreted as unlimited.

    Folders can be listed by default: This enables or disables the default value for directory listing. If there is no listing property set for a folder (either via the vfolder management dialog or with the Htaccess file), this is the value that will be used.

    Files can be downloaded by default: This enables or disables the default value for file downloads. If there is no download property set for a folder (either via the vfolder management dialog or with the Htaccess file), this is the value that will be used.

    Date format: This is the date format used to describe the last modification time in files listed in a standard directory listing.

    Starting MotionWS2

    There are two ways to start MotionWS2: either you can use the command /mws.start, or you can use the menu located in your main menubar and in your status menu. They both do exactly the same.

    When MotionWS2 have been started, you should be able to access it by opening the url http://localhost in your webbrowser. If you specified a port other than 80, you have to append the port number to the hostname, e.g http://localhost:700/ if you set it to use port 700.

    Virtual folders

    Virtual folders are folders that exists on your webserver, but not on your computers filesystem. This lets you create your own hierarchy of files and folders just the way you like it. As a concrete example, you could map the virtual folder /music to a folder on you harddrive, such as D:\My Files\My Music. Users can now access this folder by going to http://yourhost.com/music.

    Furthermore, any subfolders added to the virtual folder will automatically be translated over to your physical directory. For example, if someone opened the url http://yourhost.com/music/MP3/metal that would be translated into D:\My Files\My Music\MP3\metal.

    Managing virtual folders is done by opening the dialog for managing virtual folders. This can be done by using the /mws.vfolders command or by using the menu in your menubar or status window.

    Managing virtual folders

    Virtual folder name: This is the name of the virtual folder. You should always start the virtual folder name with a forward slash (/).

    Physical folder: This is the folder to which the virtual folder is mapped. This folder should exist, however the virtual folder will still be added even if it doesn't exist. Using a virtual folder name that already exist will overwrite the previous entry.

    The contents of this folder can be listed: Indicates that the contents of this virtual folder can be listed in a directory listing. This setting is however overridden by directives in an eventuel htaccess file.

    The contents of this folder can be downloaded: Indicates that the contents of this virtual folder can be downloaded. Otherwise same as above.

    Username: Sets a username for this folder.

    Password: Sets a password for this folder.

    Stopping and restarting

    To stop the webserver, use the command /mws.stop or use the menu in your menubar or status window. To restart the webserver, use /mws.restart or the menu in your menubar or status window.

    Using the Htaccess file

    MotionWS gives you the ability to put a htaccess file in a directory to specify properties for that directory. These properties are the same as you can set for a virtual folder. However, a Htaccess file will always override a virtual folder setting. This means that if you map the virtual folder "/mp3" to "D:\mp3" and then set the listing property to false, the directory will still be listed if you have a Htaccess file that specifies this.

    Note! Just as with virtual folders, properties are inherited downwards in the folder hierarchy.

    The content of the Htaccess file is as follows:
    
    Get <true|false>
    List <true|false>
    Username <Bob>
    Password <BobsPassword>
    			
    This should be fairly self explanatory. The properties correspond to those of virtual folders. You can use a semicolon ";" to comment out lines. An example Htaccess file would look like this:
    
    ; ## Access file for MP3 directory
    Get true
    List false
    Username Leech
    Password LeechingSucks
    			

    CGI

    MotionWS comes with a built-in CGI gateway. This let's you run any interpreted language that can be run through CGI. MotionWS have been tested and verified to be working with the following languages:

    PHP 4.3.2http://www.php.net/
    Perl 5.8.0http://www.activestate.com/Products/ActivePerl/
    Python 2.3http://www.python.org
    Ruby 1.8.0http://www.ruby-lang.org/en/
    Tcl 8.4.2.4http://tcl.sourceforge.net/


    Note! For the CGI gateway to work, you need to have a NT based operative system (Windows XP, Windows 2000, Windows NT, Windows Server 2003). This is because the CGI gateway utilizes the Windows Scripting Host, and a special set of system calls within these (VB) scripts. Additionally, antivirus software might not be too happy with what MotionWS does when it's processing CGI requests, and will slow down and possibly halt MotionWS' processing of CGI. MotionWS have been successfully tested with AVG antivirus.

    Configuring MotionWS for use with any of these languages is very simple. Here's a detailed step-by-step procedure to install PHP as a CGI executable with MotionWS:

    1. Download PHP from http://www.php.net/downloads.php.

    2. Unzip/Install PHP to a directory somewhere on your computer, but remember the directory you chose.

    3. Start your copy of mIRC that's running MotionWS, and select the "Manage CGI" menu item from the main MotionWS menu.

    4. In the dialog that pops up, click the "Add.." button, and enter a file extension you would like to be processed by PHP. A suitable file extension would be php, php3 or php4.

    5. Enter the path to the main PHP exeutable in the "CGI executable" textbox, or browse for it by pressing the "..." button. If you installed PHP to C:\php, then the PHP executable will be located in C:\php\php.exe.

    6. Open the main configuration dialog (/mws.config) and check the "Enable CGI" checkbox.

    7. Test the CGI gateway by putting a php script in your htdocs directory and browsing to it using your webbrowser. A good test script could be the following:
    <?php
      phpinfo();
    ?>
    

    which will output the standard phpinfo() stuff. If the CGI gateway is working properly, you should notice the "CGI/FastCGI" text in the first table.

    To add further file extensions, repeat steps 4 through 5.

    Automatic updating

    MotionWS2 ships with the ability to update itself automatically if there are new versions available. To use this feature, you can either access the "Check for updates" menu, or you can use the /mws.updatecheck command. If there is a new version available, information about it will pop up in a dialog. You will then be prompted to download the update or not.

    Automatic updates does NOT erase your configuration files! However, if you have customized your error pages or folder icons, you must make a backup of these before you download the update.

    To download the latest update regardless of version difference, use the command /mws.update. This will download and install the latest stable release of MotionWS2. Useful if you are having trouble using the latest full install build.

    MHTML

    Please read mhtml2.txt for info on Mhtml v2

    Note! At this date, MotionWS2 does not support POST data. This will be added in a later release.

    Troubleshooting

    If you have configured MotionWS2 correctly, you should be able to access the webserver on http://localhost/. However, if nothing happens, try turning on debugging and then restart the webserver. This way you might be able to spot some error messages that might help you out.




































    eof.